home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ada
/
atutr202.zip
/
ada_tutr.ada
< prev
next >
Wrap
Text File
|
1992-09-04
|
26KB
|
519 lines
-- ADA_TUTR.ADA Ver. 2.02 4-SEP-1992 Copyright 1988-1992 John J. Herro
-- Software Innovations Technology
-- 1083 Mandarin Drive NE, Palm Bay, FL 32905-4706 (407)951-0233
--
-- Before compiling this file, you must compile ONE of the following:
--
-- JANUS.ADA Recommended when using a PC with Janus/Ada.
-- MERIDIAN.ADA Recommended when using a PC with a Meridian Ada compiler
-- and the Meridian DOS Environment Library.
-- UNIX.ADA Recommended for UNIX based systems, if you can also
-- compile ONECHAR.C or ALTCHAR.C with a C compiler and
-- link with Ada.
-- VAX.ADA Recommended when using VAX Ada.
-- VANILLA.ADA "Plain vanilla" version for all other systems. Should work
-- with ANY standard Ada compiler. On some systems,
-- VANILLA.ADA may require you to strike ENTER after each
-- response. However, you don't have to strike ENTER with
-- recent versions of TeleGen Ada by Telesoft.
--
-- See the PRINT.ME file for more information on installing ADA-TUTR on other
-- computers.
--
--
-- Before Running ADA-TUTR on a PC:
--
-- ADA-TUTR uses ANSI escape sequences for highlighting, cursor positioning,
-- reverse video, etc. Before ADA-TUTR will work correctly on a PC, you must
-- install the device driver ANSI.SYS, which came with your copy of DOS. To
-- install ANSI.SYS, do the following:
--
-- 1. If there's a file CONFIG.SYS in the root directory of the disk from
-- which you boot, type it and look for a line saying "DEVICE=ANSI.SYS"
-- (without the quotes), in either upper or lower case. If that line isn't
-- present, add it to CONFIG.SYS anywhere in the file, using an ordinary
-- text editor or word processor in the non-document mode. If there's no
-- CONFIG.SYS file, create one containing the single line "DEVICE=ANSI.SYS"
-- (without the quotes).
--
-- 2. If there's no file ANSI.SYS in your root directory, copy ANSI.SYS from
-- your DOS distribution diskette to the root directory of the disk from
-- which you boot.
--
-- 3. Reboot the computer. ADA-TUTR should then work correctly.
--
-- Introduction:
--
-- ADA-TUTR provides interactive instruction in the Ada programming language,
-- allowing you to learn at your own pace. On a PC, access to an Ada compiler
-- is helpful, but not required. You can exit this program at any time by
-- striking X, and later resume the session exactly where you left off. If you
-- have a color monitor, you can set the foreground, background, and border
-- colors at any time by typing S.
--
-- ADA-TUTR presents a screenful of information at a time. Screens are read
-- in 64-byte blocks from the random access file ADA_TUTR.DAT, using DIRECT_IO.
-- For most screens, ADA-TUTR waits for you to strike one character to
-- determine which screen to show next. Screens are numbered starting with
-- 101; each screen has a three-digit number. Screens 101 through 108 have
-- special uses, as follows:
--
-- 101 - This screen is presented when you complete the Ada course. It
-- contains a congratulatory message. After this screen is shown,
-- control returns directly to the operating system; the program doesn't
-- wait for you to strike a character.
-- 102 - This screen is presented when you exit ADA-TUTR before completing the
-- course. After this screen is shown, control returns directly to the
-- operating system; the program doesn't wait for you to strike a
-- character.
-- 103 - This screen is shown whenever you strike X. It displays the number of
-- the last screen shown and the approximate percentage through the
-- course. It then asks if you want to exit the program. If you strike
-- Y, screen 102 is shown and control returns to the operating system.
-- If you type N, screen 108 is shown to provide a menu of further
-- choices. From screen 103, you can also strike M to see the main menu
-- (screen 106).
-- 104 - This is the opening screen. It asks if you've used ADA-TUTR before.
-- If you strike N, a welcome screen is presented and the course begins.
-- If you strike Y, screen 107 is shown.
-- 105 - This screen allows you to type the number of the next screen you want
-- to see. For this screen, instead of striking one character, you type
-- a three-digit number and presses ENTER. Any number from 104 through
-- the largest screen number is accepted.
-- 106 - This screen contains the main menu of topics covered in ADA-TUTR.
-- When you select a main topic, an appropriate sub-menu is shown.
-- 107 - This screen is shown when you say that you've used ADA-TUTR before.
-- It says "Welcome back!" and provides a menu that lets you resume where
-- you left off, go back to the last question or Outside Assignment, go
-- to the main menu (screen 106), or go to any specified screen number
-- (via screen 105).
-- 108 - This screen is shown when you answer N to screen 103. It provides a
-- menu similar to screen 107, except that the first choice takes you
-- back to the screen shown before you saw 103. For example, if you
-- strike X while viewing screen 300, you'll see screen 103. If you then
-- answer N, you'll see screen 108. From 108 the first menu selection
-- takes you back to 300.
--
-- Format of the Data File:
--
-- ADA-TUTR.DAT is a random access file of 64-byte blocks. The format of this
-- file changed considerably with version 2.00 of ADA-TUTR. It's now much more
-- compact, and, although it's still a data file, it now contains only the 95
-- printable ASCII characters.
--
-- The first block of ADA_TUTR.DAT is referred to as block 1, and the first 31
-- blocks together are called the index. Bytes 2 through 4 of block 1 contain,
-- in ASCII, the number of the welcome screen that's shown when you say that
-- you haven't used ADA-TUTR before. Bytes 6 through 8 of block 1 contain the
-- number of the highest screen in the course. (Bytes 1 and 5 of block 1
-- contain spaces.)
--
-- Bytes 9 of block 1 through the end of block 31 contain four bytes of
-- information for each of the possible screens 101 through 594. For example,
-- information for screen 101 is stored in bytes 9 through 12 of block 1, the
-- next four bytes are for screen 102, etc. For screens that don't exist, all
-- four bytes contain spaces.
--
-- The first of the four bytes is A if the corresponding screen introduces an
-- Outside Assignment, Q if the screen asks a question, or a space otherwise.
-- The next two bytes give the number of the block where data for the screen
-- begins, in base 95! A space represents 0, ! represents 1, " represents 2,
-- # represents 3, $ represents 4, etc., through all the printable characters
-- of the ASCII set. A tilde (~) represents 94.
--
-- The last of the four bytes gives the position, 1 through 64, within the
-- block where the data for this screen starts. Again, ! represents 1,
-- " represents 2, # represents 3, etc.
--
-- Data for the screens are stored starting in position 1 of block 32. In the
-- screen data, the following characters have special meaning:
--
-- % turns on high intensity.
-- @ displays the number of spaces indicated by the next
-- character (# represents 3, $ represents 4, etc.)
-- \ turns on reverse video and leaves one space.
-- ^ turns on high intensity and leaves one space.
-- ` restores normal video.
-- { causes CR-LF.
-- } moves cursor to row 24, column 1, for a prompt.
-- ~ restores normal video and leaves one space.
--
-- These characters have special meaning in screen 103 only:
--
-- # shows approximate percentage through the course.
-- $ shows the number of the screen seen before 103.
--
-- Immediately after }